﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using GeneralLibs;
using Lists;

namespace BasicForms
{
    public partial class FrmShowLichSuMuaBanHang : BasicForms.FrmBase
    {
        Guid _VTHHID = Guid.Empty;
        public FrmShowLichSuMuaBanHang(Guid vtthID)
        {
            _VTHHID = vtthID;
            InitializeComponent();
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            try
            {
                switch (keyData)
                {
                    
                    case Keys.Escape:
                        this.Close();
                        return true;
                        break;
                    default:
                        return base.ProcessCmdKey(ref msg, keyData);
                        break;
                }
            }
            catch (Exception ex)
            {
                BasicForms.FrmExceptionNotifier.ShowAndLog(ex);
                return false;
            }
        }

        private void FrmShowLichSuMuaBanHang_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = DanhMucVatTuHangHoa.GetLichSuGiaMua(_VTHHID);
                gridControl.DataSource = dt;
                FormatNumberInGridView(gridView);
            }
            catch (Exception ex)
            {
                BasicForms.FrmExceptionNotifier.ShowAndLog(ex);
            }
        }
    }
}
